/**
 * 
 */
package rgbos.forum.search;

import java.util.Vector;

import rgbos.forum.domain.Auditor;
import rgbos.forum.domain.ControlFacade;
import rgbos.forum.domain.Post;

/**
 * @author IL024610
 *
 */
public class IndexDeamon implements Runnable{
	private ControlFacade handler_;
	
	public IndexDeamon(ControlFacade handler){
		this.handler_=handler;
	}
	@Override
	public void run() {
		Vector<Post> vp= handler_.getAllPost();
		for (Post post : vp) {
			handler_.getSearchEngine().indexPost(post);
		}
		Auditor.Log("index deamon finished indexing.", this.getClass());
	}
	
}
